Methods and apparatus for parallel execution of a process

ABSTRACT

One embodiment of the invention is directed to executing a computer program that manipulates data stored in a distributed manner on a parallel server. At least one portion of the computer program treats the data from a global perspective, wherein commands to the parallel server are not specific to the manner in which the data is distributed on the parallel server. In addition, at least one portion of the computer program treats the data from a local perspective, wherein commands to the parallel server are specific to the manner in which the data is distributed on the parallel server.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.11/262,475, filed Oct. 28, 2005, entitled Methods And Apparatus ForParallel Execution Of A Process, which in turn claims the benefit under35 U.S.C. §119(e) of co-pending U.S. Provisional Application Ser. No.60/623,682, filed Oct. 29, 2004, entitled “A Method And System For AnInteractive Parallel Programming Environment” by Long Yin Choy, et. al.The contents of application Ser. No. 11/262,475 and Application No.60/623,252 are incorporated herein by reference in their entirety.

FIELD OF THE INVENTION

The present invention relates to providing parallel processingcapability.

DESCRIPTION OF THE RELATED ART

Parallel computing is the concurrent use of multiple processors to solvea computational problem. Large problems may take significant time tosolve or may be impossible to solve using only a single processor. Thus,such problems may be divided among multiple processors, each of whichsolves a portion of the problem.

However, writing program code to solve a computational problem inparallel may present challenges. For example, a programmer may have todevise a complex algorithm to determine an efficient way in which todivide the problem up among the multiple processors, how memory shouldbe allocated and shared among these processors, and how messages shouldbe passed between processors.

As used herein, the term “computer program” refers to a related set ofstatements or instructions to be used directly or indirectly in acomputer in order to bring about a certain result. Different portions ofthe same computer program may be stored in different files and/or ondifferent computers.

The programmer may also wish to employ pre-existing parallel computingsoftware packages, such as, for example, parallel virtual machine (PVM)or message passing interface (MPI) packages, so that routines forsharing data between processors, spawning additional processes, andother general parallel computing tasks need not be coded from scratch.Thus, the programmer may have to be familiar with such softwarepackages.

SUMMARY

One aspect of the invention is directed to a method of processing acomputer program that manipulates a data structure stored on a parallelserver comprising a plurality of processors, wherein a portion of thedata structure is stored on each of the plurality of processors. Themethod comprises acts of: (a) executing a first routine based on code inthe computer program that causes a first request to perform a firstoperation on the data structure to be sent to the parallel server,wherein the first routine is a routine that overloads a serial routinethat, when executed, causes the first operation to be performedserially; and (b) executing a second routine based on code in thecomputer program that causes a second request to be sent to the parallelserver, wherein the second request includes an instruction to at leastone specific processor of the plurality of processors to perform asecond operation on the portion of the data structure stored on the atleast one specific processor. Another aspect is directed to at least onecomputer readable medium encoded with instructions that, when executedon a computer system, perform the above-described method.

A further aspect is directed to a computer that executes a computerprogram for manipulating a data structure stored on a parallel servercomprising a plurality of processors, wherein a portion of the datastructure is stored on each of the plurality of processors. The computercomprises: an output for sending data to the parallel server; and atleast one controller, coupled to the output that: (a) executes a firstroutine based on code in the computer program that causes a firstrequest to perform a first operation on the data structure to be sent tothe parallel server, via the output, wherein the first routine is aroutine that overloads a serial routine that, when executed, causes thefirst operation to be performed serially; and (b) executes a secondroutine based on code in the computer program that causes a secondrequest to be sent to the parallel server, via the output, wherein thesecond request includes an instruction to at least one specificprocessor of the plurality of processors to perform a second operationon the portion of the data structure stored on the at least one specificprocessor.

Another aspect is directed to a method of processing a computer programwritten in an interpreted programming language that manipulates a datastructure stored on a parallel server comprising a plurality ofprocessors, wherein a portion of the data structure is stored on each ofthe plurality of processors. The method comprises acts of: (a) executinga first routine based on code in the computer program that causes afirst request to perform a first operation on the data structure to besent to the parallel server; and (b) executing a second routine based oncode in the computer program that causes a second request to be sent tothe parallel server, wherein the second request includes an instructionto at least one specific processor of the plurality of processors toperform a second operation on the portion of the data structure storedon the at least one specific processor. A further aspect is directed toat least one computer readable medium encoded with instructions that,when executed on a computer system, perform the above-described method.

Another aspect is directed to a computer that executes a computerprogram written in a interpreted programming language for manipulating adata structure stored on a parallel server comprising a plurality ofprocessors, wherein a portion of the data structure is stored on each ofthe plurality of processors. The computer comprises: an output forsending data to the parallel server; and at least one controller,coupled to the output that: (a) executes a first routine based on codein the computer program that causes a first request to perform a firstoperation on the data structure to be sent to the parallel server, viathe output; and (b) executes a second routine based on code in thecomputer program that causes a second request to be sent to the parallelserver, via the output, wherein the second request includes aninstruction to at least one specific processor of the plurality ofprocessors to perform a second operation on the portion of the datastructure stored on the at least one specific processor.

A further aspect is directed to a method of processing a computerprogram that manipulates a data structure stored on a parallel servercomprising a plurality of processors, wherein a portion of the datastructure is physically stored on each of the plurality of processors.The method comprises acts of: (a) executing a first routine based oncode in the computer program that causes a first request to perform afirst operation on the data structure to be sent to the parallel server;and (b) executing a second routine based on code in the computer programthat causes a second request to be sent to the parallel server, whereinthe second request defines an abstract splitting of the data structurethat defines a plurality of abstract portions of the data structure, andwherein the second request includes an instruction to perform a secondoperation on at least one of the plurality of abstract portions.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a block diagram of a system in which global operations ondata may be performed;

FIG. 1B is a block diagram of a system in which local operations on datamay be performed;

FIG. 2 is a block diagram of a system adaptable to perform a process ofa scientific computing software application in parallel, in accordancewith some embodiments for practicing the teachings herein;

FIG. 3 is a block diagram of an example of parallel server that executesthe server software of FIG. 2, in accordance with the methods andsystems as taught herein;

FIG. 4 is a block diagram of an example of parallel server that executesthe server software of FIG. 2, in accordance with the methods andsystems as taught herein;

FIG. 5 is a block diagram of an object that reference local data inaccordance with the methods and systems as taught herein;

FIG. 6 is a block diagram of a matrix row-distributed on a parallelserver.

FIG. 7A is a diagram of a stencil-splitting of a matrix in accordancewith the methods and systems taught herein; and

FIG. 7B is a diagram of a multi-grid splitting of a matrix in accordancewith the methods and systems taught herein.

DETAILED DESCRIPTION

Many programmers have existing computer programs or computer code thatwas originally designed to be run serially (i.e., on a singleprocessor). Applicants have appreciated that it often may be desirableto use such serial computer program code in the context of a parallelcomputing platform, to take advantage of parallel processingcapabilities. Achieving this goal, however, is non-trivial.

More specifically, Applicants have appreciated that, in a parallelcomputing environment, a user may wish to treat data in different wayswithin the same parallel program. Thus, a user may wish to take a“global” view of the data, in which an object stored on the parallelserver is viewed by the user as a single object, even though the objectmay be distributed across multiple processors of the parallel computer.As used herein, the term “processor” refers to a processor core and itsassociated components. Thus, a single integrated circuit or chip thathas multiple processor cores may be considered to be multipleprocessors. Thus, for example, an integrated circuit or chip with twoprocessor cores may be considered to be two processors, an integratedcircuit or chip with four processor cores may be considered to be fourprocessors, and an integrated circuit or chip with n processor cores maybe considered to be n processors.

Thus, the user need not be aware of how the object is distributedamongst the multiple processors of the parallel server or what actioneach individual processor takes to perform an operation on the object inparallel. An example of a series of global view operations is providedin FIG. 1A.

The system of FIG. 1A includes a parallel server 101 and a client 103,which sends commands to and receives results from parallel server 101.Parallel server 101 includes three processors, 105 a, 105 b, and 105 c,though a user sending global view commands to parallel server 101through client 103 need not be aware of the number of processors beingused in parallel server 101. As shown in FIG. 1A, client 103 may createa Matrix A on parallel server 101, which may be, for example, a 3×2matrix of integer values. Parallel server 101 may distribute the data ofMatrix A amongst processors 105 a, 105 b, and/or 105 c in any suitableway and the user need not be aware of how this data is distributed orthat it is distributed.

For example, parallel server 101 may row-distribute the data, such thateach processor stores one row of Matrix A. That is, processor 105 a maystore element (0,0) and element (0,1), processor 105 b may store element(1,0) and element (1,1) and processor 105 c may store element (2,0) andelement (2,1). Alternatively, the parallel server may column-distributethe data so that each column of Matrix A is stored on one of theprocessors 105 of parallel server 101. For example, element (0,0),element (1,0), and element (2,0) may be stored on processor lOSa, whileelement (0,1), element (1,1), and element (2,1) may be stored onprocessor 105 b. Any other suitable distribution of data may be used, asthe invention is not limited in this respect.

It should be appreciated that when data is referred to herein as beingstored on a particular processor or a particular processor is referredto as storing data, this does not require that the data be physicallystored on the processor. Rather, data being stored on a processor or aprocessor storing data means that the data is stored in memory that isallocated to or under control of the processor. Likewise, when data isreferred to herein as being distributed amongst processors, it is notrequired that the data be physically stored on the processors, butrather means that the data is stored in one or more memories and eachprocessor is allocated or controls memory that stores at least a portionof the data.

From the user's global view perspective, the manner in which Matrix A isdistributed amongst the processors 105 is irrelevant. Client 103 maysubsequently create a second matrix, Matrix B, on the parallel server.Matrix B may, for example, also be a 3×2 matrix of integer values andmay also be distributed amongst processors 105 in any suitable way.Matrix A and Matrix B need not be distributed amongst the processors inthe same way. For example, the parallel server may row-distribute MatrixA, but may column-distribute Matrix B. However, like Matrix A, themanner in which Matrix B is distributed amongst the processors 105 isirrelevant when taking a global view of the data.

Client 103 may next send a command to parallel server 101 to add MatrixA and Matrix B and store the result in a third matrix, Matrix C. Becausethe user is unaware of how Matrix A and Matrix B are distributed amongstprocessors 105, the user is unable to instruct each processor on whataction to take to add Matrix A and Matrix B. However, parallel server101 is aware of how these matrices are distributed. Thus, when parallelserver 101 receives the command to add Matrix A and Matrix B, eachprocessor 105 may be instructed to take the appropriate actions to addthe two matrices. For example, if both Matrix A and Matrix B are rowdistributed, processor 105 a may be instructed to add the content ofcells Matrix A(0,0) and Matrix B(0,0) (hereinafter, simply referred toas adding the referenced cells) and to add Matrix A(0,1) and MatrixB(0,1). Likewise, processor 105 b may be instructed to add Matrix A(1,0)and Matrix B(1,0) and to add Matrix A(1,1) and Matrix B(1,1). Similarly,processor 105 c may be instructed to add Matrix A(2,0) and Matrix B(2,0)and to add Matrix A(2,1) and Matrix B(2,1). The result of the additionof Matrix A and Matrix B is a 3×2 row-distributed matrix (i.e., MatrixC). Parallel server 101 may return a pointer or handle that the clientmay use to refer to Matrix C. Client 103, using the pointer or handlereturned from parallel server 101, may subsequently request thatparallel server return Matrix C to the client. In response, parallelserver 103 may instruct each processor 105 to return the portion ofMatrix C that it stores. Thus, for example, processor 105 a may returnMatrix C(0,0) and Matrix C(0,1), processor 105 b may return MatrixC(1,0) and Matrix C(1,1), and processor 105 c may return Matrix C(2,0)and Matrix C(2,1).

In addition to taking a global view of data, the user may, in somesituations take a “local” view of the data. When treating data from alocal perspective, a user may be aware of how an object is split amongstprocessors and may instruct specific processors to perform operations onthe portions of the distributed object that they store. Thus, forexample, if a user has previously-written serial code that operates on acertain type of data, the user may instruct each processor to executethat code on the portion of the distributed data it stores.

As used herein, a splitting of an object or data structure, such as, forexample, a matrix, amongst processors may be an “abstract splitting” ora “physical distribution.” In a physical distribution, data isphysically distributed among the processors in the manner specified inthe splitting. For example, if a matrix is physically row-distributed,then each row of the matrix is stored on a different processor. In anabstract splitting, data is split among abstract processors and theabstract splitting may have little or nothing to do with the way inwhich data is physically distributed among the physical processors. Theterm “abstract processor” as used herein, refers to a non-physicalvirtual processor whose operations may be performed by one or morephysical processors. For example, a 2×4 matrix may be physicallyrow-distributed on a parallel server that has two processors, such thatone row of the matrix is physically stored on each processor. However,the same matrix may be abstractly split amongst four abstractprocessors, such that each column of the matrix is abstractly stored onone of the four abstract processors. Thus, for the purposes ofperforming operations on the matrix, the matrix is treated by theparallel server and the user as if it were column-split among fourprocessors, though the actual physical distribution of the data is arow-distribution among two physical processors.

An example of a series of local view operations is provided in FIG. 1B.In FIG. 1B, client 103 creates a Matrix A on parallel server 101. As inthe example of FIG. 1A, Matrix A may be a 3×2 matrix of integers. Theuser may have previously written a serial routine called, for example,‘avg’ that takes as input a 1×2 matrix of integers, computes the averageof the two integers in the matrix, and outputs the average as a 1×1matrix. Thus, Client 103 may subsequently send a command to parallelserver 101 to row-split Matrix A across processors 105 a, 105 b, and 105c so that each processor has 1×2 matrix that is one row of Matrix A. Itshould be appreciated that, in some embodiments, processors 105 a, 105b, and 105 c may be abstract processors and the row-splitting may be anabstract splitting. That is, the data of Matrix A may be physicallystored on the physical processors of parallel server 101 in a mannerdifferent from the row-splitting described above. Alternatively, inother embodiments, the row-splitting of Matrix A may be a physicaldistribution. That is, processors 105 a, 105 b, and 105 c may bephysical processors and one row of Matrix A may be physically stored oneach of these processors.

Client 103 may instruct the parallel server to have each processor 105execute the previously-written ‘avg’ routine, using the 1×2 matrixstored on the processor as input. The results of this operation is thatthere is a 1×1 matrix stored on each of processors 105, wherein thevalue in each of the 1×1 matrices is the average of the numbers in oneof the rows of Matrix A. In embodiments in which Matrix A is abstractlyrow-split, it should be appreciated that is the abstract processors thateach execute the ‘avg’ routine. At the physical level, depending on howthe data is physically distributed among the processors, some or all ofthe physical processors may execute the ‘avg’ routine or some physicalprocessors may execute the ‘avg’ routine multiple times using differentportions of the matrix physically stored thereon as input. In someembodiments, the ‘avg’ routine is not executed at all, but rather theparallel server causes the physical processes to perform operations thatwould have the same result as executing the ‘avg’ routine on eachprocessor that stores a row of the row-split matrix.

One embodiment of the invention is directed to providing a utility whichallows a user to write a program to be executed on the parallel serverthat uses both a global view of data and local view of data. That is, aportion of the program may operate on the data globally, while anotherportion of same program operates on the data locally.

U.S. patent application Ser. No. 11/217,114, titled “METHODS ANDAPPARATUS FOR PARALLEL EXECUTION OF A PROCESS,” filed on Aug. 31, 2005(hereinafter, “the '114 application”), which is hereby incorporated byreference in its entirety, describes a system in which a user may writeparallel programs using a global view of the data. Specifically, theapplication describes a system that employs a scientific computingsoftware application to write programs which are then “parallelized” bysoftware on the parallel server. As used herein, the term scientificcomputing software application refers to a software application capableof solving computational problems that are input by a user. Examples ofcommercially available scientific computing software applicationsinclude MATLAB™, produced and sold by The MathWorks, Natick,Massachusetts, Maple™, produced and sold by Maplesoft, Waterloo,Ontario, Canada, Mathematica™, produced and sold by Wolfram Research,Champaign, Illinois, Octave, produced and distributed by GNU, andExcel™, produced and sold by Microsoft Corporation, Redmond, Wash.

The system of the '114 application that allows a user to operateglobally on distributed data is described below and may employ atechnique referred to as overloading. As used herein, the termoverloading refers to having two or more objects or methods that havethe same name but have different meanings or functionalities dependingon the context in which the object or method is used. For example, whichmethod is called may depend on the number of parameters with which themethod is called or the data type of parameters with which the method iscalled. That is, a programmer may define two methods each named Area.The first Area method may take as a parameter a user-defined data typecalled Triangle and computes the area of a triangle. The second Areamethod may take as a parameter a user-defined data type called Circleand computes the area of a circle. Thus, simply from the line of code“B=Area(A),” it cannot be determined which Area method is to be called.That is, if the variable A is of the data type Triangle, the first Areamethod is called, while if the variable A is of the data type Circle,the second Area method is called.

As another example, from the programmer's perspective, the method callfor the two or more methods that share the same name may be identical.That is, the method name, the number of parameters and the type ofparameters are the same for both (or all) of the methods and thedecision as to which of the two or methods is called is not made by theprogrammer at the time of programming. For example, the line of codex+y, where both x and y are variables that represent matrices ofintegers may have different functionality depending on the context inwhich the line of code is written. Thus, for example, if both x and yare small matrices, an addition routine that performs a normal matrixaddition may be called. However, if either x or y represents a matrixlarger than a certain size an addition routine that performs the matrixaddition in parallel may be called. The decision as to which additionroutine is to be called may be made in any suitable way as the inventionis not limited in this respect. For example, the decision may be madeeither at compile time, at run time, or at any other suitable time.Further, the decision may be made by any suitable entity, such as thecompiler or interpreter of the programming language, or an outsidesoftware program (though the compiler, interpreter, or outside softwareprogram may be manually configured, e.g., by a programmer, to make thesedecisions in a certain way).

As in the example above, operators may also be overloaded. For example,the function of the ‘+’ operator in the line of code ‘C=A+B’ may bedifferent depending on the data types of the operands A and B. That is,if the operands A and B are integers, the ‘+’ operator may be defined toperform a integer addition. However, if the operands A and B are arraysor matrices, the ‘+’ operator may be defined, by the programmer, toperform a matrix addition.

FIG. 2 is an example of a system in which polymorphism (e.g., byoverloading methods and/or operators) may be used to provide parallelcomputing capability to a scientific computing software application. Thesystem of FIG. 2 includes a scientific computing software application201, communication software 203, and server software 205.

In one embodiment, operators and/or methods of a program of scientificcomputing software application 201 may be overloaded. The overloadedmethods and/or operators may be defined to pass a message tocommunication software 203 requesting that a certain operation orprocess be performed in parallel. Communication software 203, inresponse to receiving the message, may then send a command to serversoftware 205 to perform the process in parallel. This may be done in anysuitable way, as the invention is not limited in this respect. Forexample, a new data type or class may be defined and operators and/ormethods may be overloaded such that when the operators and/or methodsare called with a parameter or operand of the newly defined data type,the overloaded method is called.

As an example, the rand function in the programming language of ascientific computing software application may be a built-in method ofscientific computing software application 201 that creates an n-by-nmatrix of randomly-valued entries, where n is an integer value specifiedin the parameter of the method. Thus, the line of code in Table 1creates a 100-by-100 matrix of random numbers and stores the result inthe variable ‘X.’ The server software may then pass out tasks to aplurality of processors, to complete the task or tasks require by themethod.

TABLE 1 X = rand(100);

However, the rand method may be overloaded so that if the parameterprovided is of the new data type (i.e., as opposed to an integer orscalar), then the overloaded rand method is called rather than thebuilt-in rand method. For example, in the line of code in Table 2, theparameter provided to the rand method is “100*p.” The variable p may bean object of the new data type or class which, for the purposes of thisexample is called the dlayout class. The * operator may be the built-inmultiplication operator of scientific computing software application201, which takes two operands. However, the * operator may beoverloaded, such that when one or both of its operands are objects ofthe dlayout class, the overloaded operator is called. The overloaded *operator may return an object of the dlayout class.

TABLE 2 X = rand(100*p);

Thus, the operation “100*p” in Table 2 may return a dlayout object. Therand method may also be overloaded so that when the parameter providedis a dlayout object (instead of an integer or scalar), the overloadedrand method is called. The overloaded rand method may call communicationsoftware 203 which sends a command to server software 205 to create adistributed 100-by-100 matrix. The overloaded rand method may return anobject of a user-defined data type or class that may be used as a nameor handle to reference the matrix created on the parallel server. Forexample, the overloaded rand method may return an object of theuser-defined ddense class, which is stored in the variable X. Thus, thedistributed matrix on the parallel server may be accessed andmanipulated using the variable X. For example, as shown in Table 3, amethod for computing the eigenvalues of a matrix may be performed on thedistributed matrix.

That is, the built-in method eig of scientific computing softwareapplication 201 may take a matrix or an array as its parameter. However,the eig function may be overloaded so that if the parameter provided tothe method is an object of the ddense class, the overloaded method iscalled. Like the overloaded rand method, the overloaded eig method, whencalled, may call communication software 203 which may send a command toserver software 205 to calculate the eigenvalues of the distributedmatrix X. The overloaded eig method may also return an object of theddense class, which is stored in the variable Y, and may be used as ahandle to access the matrix of eigenvalues on the parallel server.

TABLE 3 Y = eig(X)

Because the overloaded methods and/or operators used to contact theparallel server as well as the parallel algorithms that execute on theparallel server may be provided for the user of the scientific computingsoftware application (i.e., without the user having to code them), theuser need not have detailed knowledge of parallel programming. Rather,much of the parallel processing capability is transparent to the user.

For example, continuing with the examples provided above, from theuser's perspective, the only difference in the program code needed tocreate a 100-by-100 matrix of random numbers and compute its eigenvaluesis the addition of the tag “p” in the parameter of the rand method, asshown above in Table 2. However, the “p” tag causes a distributed matrixto be created on the parallel server and future operations on the matrixto be performed in parallel, without the user having to devise or codean parallel algorithms. In the examples above, the rand and eig methodsand the * operator were overloaded to perform certain operations inparallel, such as creating a distributed matrix on a parallel server andcomputing its eigenvalues in parallel. However, the invention is notlimited in this respect, as any suitable built-in method or operator ofthe scientific computing software application may be overloaded (e.g.,to cause its functionality to be performed in parallel).

In the examples described above in connection with Tables 2 and 3, theuser is taking a global view of the data. That is, the objects X and Yare global objects and the user need not be aware of how these objectsare distributed amongst the processors of the parallel server. Thus,when the user instructs the parallel server to computer the eigenvaluesof the matrix referenced by the variable X, the user need not specifywhat specific operation each processor of the parallel server needs totake to computer these eigenvalues. Rather, server software 205 is awareof the manner in which the data is distributed and has a routine forcomputing, in parallel, the eigenvalues of a matrix that is distributedin this manner.

It should be appreciated that, although in the examples above certaindata types, classes, methods, and/or operators are described as beinguser-defined, these data-types, classes, methods, and/or operators neednot be defined by the ultimate end user of the scientific computingsoftware application. Indeed, the term user-defined is merely used todistinguish between those classes, methods, and operators that arebuilt-in to the scientific computing software application programminglanguage by its publisher's specification and those that are added in byan external programmer. Thus, in one embodiment, the overloaded methods,operators, and user-defined classes may be provided in a softwarepackage that also includes communication software 203 and serversoftware 205. The software package, when installed, may work inconjunction with scientific computing software application 201 toprovide the above-described parallel processing functionality.

Further, in the examples above, the built-in methods and operators wereonly overloaded with a single additional method or operator. However,the invention is not limited in this respect, as a method or operatormay be overloaded with any suitable number of methods or operators. Thatis, in the example provided above, the * operator was overloaded witha * operator that takes an object of the dlayout class as one of itsoperands and returns a dlayout object. However, the * operator couldalso be overloaded with an operator that takes two ddense objects (eachof which references a distributed matrix on the parallel server) as itsoperands, causes a matrix multiplication of the two distributed matricesto be performed in parallel, and returns a ddense object that serves asreference to the distributed matrix that results from the matrixmultiplication. Thus, in the example above, the * operator may performone of three different operations, depending on the data types of itsoperands.

Additionally, in the examples above, two data types or classes weredefined (i.e., dlayout and ddense). It should be appreciated that theseclass names are provided as examples and any suitable class names ordata type names may be used. Moreover, while in the examples above twouser-defined data types or classes were used in connection withproviding parallel computing capability in scientific computing softwareapplication 201, the invention is not limited in this respect, as anysuitable number of user-defined data types or classes may be used.Further, any suitable data and methods may be encapsulated in these userdefined data types, as the invention is not limited in this respect.

In one embodiment, scientific computing software application 201 andcommunication software 203 may execute on the processor of a clientcomputer, while server software 205 may execute on multiple processorsof one or more parallel servers. However, the invention is not limitedin this respect, as scientific software application 201 andcommunication software 203 may execute on any suitable processor orprocessors. For example, scientific software application 201 may executeon one of the processors of the parallel server that executes serversoftware 205. In such embodiments, the processor that executesscientific software application 201 and/or communication software 203may be viewed as the client, while the remaining processors in parallelserver 205 (individually and in collections of one or more of them) maybe viewed as the parallel server. It should be appreciated that theprocessor that executes scientific software application 201 and/orcommunication software 203 may also execute a portion of server software205. Thus, this processor may be viewed as the client as well as part ofthe parallel server.

The parallel server that executes server software 205 may be anysuitable type of parallel server, as the invention is not limited inthis respect. For example, the parallel server may be a symmetricmultiprocessing (SMP) system, a massively parallel processor (MPP)system, or may be a Beowulf cluster. In this respect, it should beappreciated that parallel server may include a plurality of separatemachines that are linked together so that they may operate on a singleproblem in parallel. A system having such an architecture may be viewedas a single parallel server, despite being made up of many individualcomputers that are also capable of operating independently of eachother.

In the examples above, overloaded methods and operators are used inscientific computing software application 201 to call and/or passmessages to communication software 203 (which, in turn, sends a commandto parallel server 205). These software entities may communicate in anysuitable way, as the invention is not limited in this respect. Forexample, in one embodiment, subroutines of communication software 203may be linked (either statically or dynamically) into scientificcomputing software application 201, so that the overloaded methodsand/or operators of scientific computing software application maydirectly call these subroutines. In another embodiment, interprocesscommunication may be used to communicate between scientific computingsoftware application 201 and communication software 203. Any suitableform of interprocess communication may be used, such as, for example,pipes, signals, message queues, semaphores, shared memory, sockets, orany other suitable form, as the invention is not limited in thisrespect.

Because scientific computing software applications are intendedprimarily for computing and modeling, the programming languages of thesesoftware applications typically do not provide the capability to performand/or handle communications over a network. Thus, in one embodiment,communication software 203 may be written in a language (e.g., C orFortran) that provides network communication capability. However, inembodiments of the invention in which the programming language ofscientific computing software application 201 allows a programmer toperform network communications, communication software 203 need not beused, and the overloaded methods and operators of scientific computingsoftware application 201 may programmed to send commands to serversoftware 205 (i.e., without using communication software 203 as anintermediary).

In embodiments wherein scientific computing software application 201 andcommunication software 203 reside on a separate machine from serversoftware 205, communication software 203 or (in embodiments wherecommunication software 203 is not used) scientific computing softwareapplication 201 may communicate with server software 205 over a network.Any suitable network protocol or protocols may be used, as the inventionis not limited in this respect. For example, in some embodiments, theTCP/IP protocol may be used. In embodiments wherein scientific computingsoftware application 201 and communication software reside on aprocessor of the parallel server that executes server software 205, anysuitable method of communication between communication software 203 (or,in some embodiments, scientific computing software application 201) andparallel server 205 may be used. For example, network basedcommunication may be used, even though the communications are notnecessarily traveling over a network; interprocess communication may beused; or any other suitable form of communication may be used, as theinvention is not limited in this respect.

Solving problems in parallel often involves operating on very large datasets. Consequently, passing results between the client and the parallelserver each time they are computed may decrease performance. Thus, inone embodiment, data may remain on the parallel server, unless resultsare explicitly requested to be sent to the client. For example, asdiscussed in above, the example line of code in Table 2 causes a commandto be sent to the parallel server to create a 100-by-100 matrixdistributed matrix of random numbers. The parallel server may create the100-by-100 matrix in response to the command. If the result of thiscomputation (i.e., the 100-by-100 matrix) were to be sent back to theclient rather than keeping the data on the parallel server, 10,000numbers may have to be sent back to the client. Further, futureoperations on the matrix to be performed by the parallel server mayinvolve sending the matrix data back to the parallel server from theclient so that the parallel server may operate on the data. Thissequence may increase network traffic, latency, and overall processingtime.

However, if the data remains on the parallel server, the data need notbe transferred unless the user of the scientific computing softwareapplication explicitly requests to view the data. For example, the100-by-100 matrix created on the parallel server using the line of codein Table 4 may remain on the parallel server and only a reference tothat data may be returned to the scientific computing softwareapplication. In the example, in Table 4, this reference is stored in theddense variable ‘X.’ Thus, if it is desired to perform future operationson the matrix, the matrix data can be identified and located on theparallel server using this reference.

If a user of a scientific software computing application desires to viewa portion of the resulting data, the user may request that this data bereturned from the parallel server and displayed. This may be done in anysuitable way, as the invention is not limited in this respect. In someembodiments, method and/or operator overloading may be used to requestthat data stored on the parallel server be returned to the client. Forexample, the line of code shown in Table 4 may be used to retrieve anddisplay the first element of the distributed matrix created by the lineof code in Table 2. Scientific computing software application 201 mayprovide, for example, a method called subsref that is used to access anarray or matrix element and invoked by the notation A(R,C), where A is avariable that represents the array or matrix and R,C refers to the rowand column of the requested matrix element. The subsref function may beoverloaded so that if called with a ddense variable as its parameterinstead of an array or matrix, a command may be sent to the parallelserver to return the requested element of the matrix that is referencedby the ddense variable.

TABLE 4 X(1,1)

Server software 205 may operate in any suitable way to receive commandsfrom the client and perform operations in parallel, as the invention isnot limited in this respect. FIG. 3 is but one example of a suitableconfiguration of server software 205 for at least some embodiments. InFIG. 3, parallel server 301 includes a plurality of processors, 303 a,303 b, . . . , 303 n, and a memory 313. Each of processors 303 a-303 nincludes four software modules: client managers 305 a, 305 b, . . . ,305 n; server managers 307 a, 307 b, . . . , 307 n; library managers 309a, 309 b, . . . , 309 n; and data managers 311 a, 311 b, . . . , 311 n.Memory 313 of parallel server 301 stores a plurality of softwarelibraries 315 a, 315 b, 315 c, . . . , 315 n that include routines forperforming various operations.

Client managers 305 interface with clients, and provides routines forreading commands and arguments from a client and sending results andother data back to the client. Server managers 307 handle communicationsbetween server processes executing on different processors of parallelserver 301. That is, server managers 307 manage the transmission of databetween the processors of parallel server 301 and collect results anderror codes from the processors. Library managers 309 are responsiblefor maintaining a list of available software libraries 315 and theroutines provided by them. When instructed by a server manager 307,library manager may perform a call to a routine of one of the libraries315. Data managers 311 include routines for creating, deleting, andchanging, data stored on the parallel server. Data managers 311 maintaina mapping between the references and/or identifiers used by the clientto identify the data and the actual storage location of the data.

In one embodiment, when server software 205 is initialized, oneprocessor may be designated the head processor and all or some of theremaining processors may be designated slave processors that operateunder the control of the head processor. The head processor may serve asthe central processor and may receive the commands from the client.Thus, in one embodiment, only the client manager module 305 on the headprocessor is used. When the head processor receives a command from theclient, the server manager 307 on the head processor may send messagesto the “slave” processors to perform the desired operation. The librarymanagers 309 on each of the processors may call the appropriate routinein libraries 315.

The server managers 307 on the processors 303 may communicate with eachother in any suitable way, as the invention is not limited in thisrespect. In one embodiment, the message passage interface (MPI)application programming interface (API) may be used. Alternatively, theparallel virtual machine (PVM) API or any other suitable from ofcommunication may be used.

In the example of FIG. 2, parallel server 301 is shown having a memory313 which stores software libraries 315. Memory 313 may be assembledfrom any suitable type of memory or memories and may include, forexample, non-volatile storage media, such as magnetic disk, opticaldisc, or tape, and/or volatile memory, such as random access memory(RAM). Further, in FIG. 2, parallel server 301 is shown having a singlememory that is shared by all processors. However, the invention is notlimited in this respect, as each processor may have a separate memory orclusters of processors may share memory. For example, in embodiments inwhich parallel server 301 is implemented as a Beowulf cluster, eachprocessor may have a separate memory and a separate copy of libraries315 (or parts thereof). Further, in some embodiments in which processors303 share a memory, portions of the memory may be allocated to eachprocessor for exclusive use by that processor. Thus, each processor maymaintain a separate copy of libraries 315 in the portion of the memoryallocated to it.

In the example of FIG. 3 parallel server 301 includes processors 303a-303 n. It should be appreciated that the parallel server may have anysuitable number of processors and the invention is not limited in thisrespect. Similarly, memory 313 may store any suitable number of softwarelibraries. Examples of software libraries that may be used are ScaLAPACKand the Parallel Basic Linear Algebra Subprograms (PBLAS) library, bothof which include parallel linear algebra routines.

In the example of FIG. 3, server software 205 is implemented, in part,as four software modules on each processor. It should be appreciatedthat the invention is not limited in this respect, as server software205 may be implemented in any suitable way. Further, it should beunderstood that the four modules in the above-described examples areintended to illustrate functionally how server software 205 may operate.However, the four modules need not be implemented as separate computerprograms and may be implemented in any suitable way, as the invention isnot limited in this respect.

In one embodiment, the system of FIG. 2 may, in addition to enabling theprogrammer to perform parallel operations using global addressing of adistributed data (i.e., referring to and operating on the distributeddata as a single object), enable the programmer to perform paralleloperations using local addressing of the same distributed object (i.e.,referring to and operating on portions of the distributed data on aprocessor-by-processor basis). That is, to multiply a Matrix A and aMatrix B that are both split amongst processors on a parallel server, aprogrammer may refer to the matrices globally with the line of codeC=A*B. Alternatively, the programmer may take a local view of the twomatrices by instructing the parallel server to distribute the matricesamongst the processors in a particular manner, and operating on eachportion of the distributed matrices separately.

An example of operating on distributed data in both a global mode and alocal mode is shown in Table 5. As in the examples above, the line ofcode “A=rand(3*p)” creates a distributed 3×3 matrix of random numbers onthe parallel server. Similarly, the line of code “B=rand(3*p)” alsocreates a distributed 3×3 matrix of random numbers on the parallelserver. The line of code “C=A+B” is global operation that adds thematrix referenced by the variable A and the matrix referenced by thevariable B. The operation is a global operation because the user doesnot instruct each processor which stores a portion of the two matriceswhat operation to perform. Rather, the user treats the two matrices asnon-distributed matrices and simply instructs the parallel server to addthem. The intelligence of what operation(s) each processor needs toperform in order to add the two matrices resides in the parallel serverand the user need not be aware of how this is done.

However, in the subsequent line of code that reads “D=ppeval(‘avg’,split(C,2))” the user operates on the data locally on each processor.The function ppeval may be a function that takes two arguments. Thefirst argument may be the name of a function to be executed on eachprocessor and the second argument is the data to be input into thefunction and a specification of how that data should be split amongstthe processors.

In the example of Table 5, the name of the function to be executed oneach processor is ‘avg.’ This may be a previously-written routine thattakes as input a 3×1 matrix, computes the average of the numbers in thematrix and returns a scalar that is the average of the numbers. Thisroutine may be executed on each of the processors of the parallel serverthat stores a portion of the input data. The routine may be provided toeach of these processors in any suitable way. In some embodiments, theroutine may be stored on the client. In such embodiments, the routinemay be provided from the client to the parallel server in a manner thatis transparent to the user. For example, the routine may be stored as afile in a file system on the client. The ppeval function may access thefile that includes the program code for the routine on the client andsend it to the parallel server for execution on each processor. In someembodiments, the parallel server may cache the routine thereon forfuture use. Thus, for example, if the same routine is used again in thecomputer program (e.g., in a subsequent invocation of the ppevalfunction) or in a different computer program, the ppeval function maydetermine if the routine has changed since the last time it was providedto the parallel server. If the routine has not changed, then theparallel server may use the cached version, without the client having toprovide the routine to the parallel server again. If the routine haschanged since the last time it was provided to the parallel server, thenthe new version of the routine may be provided to the parallel server.The determination as to whether a routine has changed since it was lastprovided to the parallel server may be made in any suitable way, as theinvention is not limited in this respect. For example, in embodiments inwhich the routine is stored as a file in a file system, the file systemtimestamp for the file may be used in determining when the routine waslast modified.

In some embodiments, the file that includes the program code for theroutine may be stored in memory on the parallel server, in addition toor instead of on the client. In such embodiments, a copy of the file maybe stored on each processor or a single copy of the file may be storedin a memory location accessible to all processors. This allows a user toexecute previously-written serial routines that the user desires tore-use in the context of parallel program.

In the examples above, the ppeval function is a function that acceptstwo arguments (i.e., the name of a routine to be executed and the inputdata to the routine). However, the invention is not limited in thisrespect, as the function used to execute a routine in local mode maytake any suitable form, may have any suitable name, and may take anysuitable number of examples. For example, the ppeval function may takeany number of arguments, where the first argument is the name of aserial routine that takes multiple arguments and the subsequentarguments are the multiple inputs to the routine. It should further beappreciated that the arguments may be presented in any suitable order,as the invention is not limited to providing the arguments in theillustrative order shown in the examples above.

FIG. 4 is one example of a suitable configuration of server software 205that may be used in a system which enables both global and localoperations. The server software is similar to the server software shownin FIG. 3, but each processor 303 also includes a scientific computingsoftware application interpreter 401. That is, processor 303 a includesscientific computing software application interpreter 401 a, processor303 b includes scientific computing software application interpreter 401b, and processor 303 n includes scientific computing softwareapplication interpreter 401 n. Scientific computing software applicationinterpreters 401 are provided on each processor to allow each processorto locally execute routines provided by the ppeval function. Forexample, the ‘avg’ routine that is the first argument in the ppevalfunction may be a routine written in the language of scientificcomputing software application 201. When this routine is provided toeach processor 303, scientific computing software applicationinterpreter 401 may interpret the routine allowing it to be executed oneach processor.

In the example above, the ‘avg’ routine is a routine written in thelanguage of the scientific computing software application 202. Thus, forexample, the computer program excerpt shown in Table 5 may be written inthe language of scientific computing software application 202 andinterpreted by an instance of the scientific computing softwareapplication interpreter executing on the client. Further, the ‘avg’routine may be written in the same programming language and interpretedby instances of scientific computing software application interpreterexecuting on each of the processors of the parallel server. However, theinvention is not limited in this respect, as the client program and theroutine to be executed on a particular processor of the parallel servermay be written in different programming languages. For example, theclient program (e.g., the program of Table 5) may be written in thelanguage of the scientific computing software application, and theroutine specified in the client program that is to be executed on aparticular processor or processors of the parallel server (e.g., the‘avg’ routine) may be written in a different program language. Forexample, this routine may be written in Perl and each processor of theparallel server may execute a Perl interpreter. Indeed, any suitableprogramming language may be used and each processor of the parallelserver may have an interpreter for processing that particularprogramming language.

In some embodiments, the programming language in which the clientprogram and/or the routine to be executed on each processor of theparallel server (e.g., the ‘avg’ routine) are written is not aninterpreted language, but rather is a compiled language. As used herein,an interpreted language refers to a programming language in which theprocessor instructions (e.g., the machine level instructions) of aprogram written in the language are generated from the program at runtime. A compiled language refers to a programming language in which theprocessor instructions of a program written in the language aregenerated from the program prior to run time. In some embodiments inwhich the routine to be executed on the processors of the parallelserver is written in a compiled language, each processor may be providedwith a compiler for that application so that it may receive the routineand compile it, so that the routine may be executed on the processor. Inother embodiment, the routine may be compiled and assembled before beingprovided to the processors of the parallel server, such that the objectcode of the routine is provide to the processors. Thus, the processorsneed not compile or interpret the routine, but may simply execute theobject code. Further, in such embodiments, the processors need not beprovided with a compiler or an interpreter to compile or interpret theroutine.

TABLE 5 A = rand(3*p); B= rand(3*p); C = A+B; D = ppeval(‘avg’,split(C,2)); D.a = D.a+1; D.b = D.b+1; D.c = D.c+1; E = ppjoin(D, 3, 1);E(0,0)

The second argument in the ppeval function specifies the input data forthe function specified in the first argument and how the input datashould be split amongst the processors. In the example of Table 5, thesecond argument to the ppeval function is “split(C,2).” This argumentindicates that the input data to the ‘avg’ routine is the matrixreferenced by the variable C. The function split is a function thatcauses the data of the matrix C to be split amongst the processors ofthe parallel server. As discussed above, this split may be an abstractsplitting or a physical distribution. The first argument of the splitfunctions specifies the data to be distributed (as well as the data tobe input into the ‘avg’ function) and the second argument specifies themanner in which the data is to be distributed. In the example of Table5, the data to be distributed is, as mentioned above, the matrixreferenced by the variable C. The second argument to the split functionis “2”. This indicates that the data is to be distributed along thesecond dimension of the n-dimensional matrix. Because the matrixreferenced by the variable C is a two-dimensional matrix, the seconddimension of the matrix is its width (i.e., the number of columns).Thus, the “2” indicates that the data of the matrix is to becolumn-split. In the example above, the matrix referenced by thevariable C is 3×3 matrix, thus the data of the matrix will be splitamongst three processors. with each processor storing one column of thematrix. If the arguments provided to the split function were split(C, 1)rather than split(C,2), than the matrix would be split along the firstdimension of the matrix (i.e., its height). Thus, split(C, 1) wouldresult in the matrix being row-split amongst three processors, whicheach processor storing one column of the matrix.

In the examples discussed above in connection with Table 5, two possiblesplittings of the matrix are discussed (i.e., row-distribution andcolumn-distribution) and syntax is provided for distributing a matrixalong its nh dimension. It should be appreciated that the invention isnot limited in this respect as the user may specify any suitablesplitting to the parallel server using any suitable syntax. For example,the matrix could be split along its diagonal, could be split into m×nblocks that are each stored on one of processors, or could be split inany other suitable way. In one embodiment, rather than splitting thematrix and distributing it, the entire matrix may be provided to eachprocessor. For example, as shown in the example of Table 6, rather thandistribute the matrix referenced by object C amongst the processors ofthe parallel server, the matrix may be broadcast to each processor, suchthat each processor stores its own copy of the entire matrix. Thus,rather than specifying split(C, 2) in the argument specifying the objectto be distributed, bcast(C) is provided, indicating that the matrixreferenced by the object C should be provided to each processor.

TABLE 6 D = ppeval(‘avg’, bcast(C));

In some embodiments, a splitting may cause an overlap of data amongprocessors. For example, a three-day-moving-average split may be used,wherein a 1×7 matrix is split such that a first processor storeselements 1, 2, and 3 of the matrix, a second processor stores elements2, 3, and 4, a third processor stores elements 3, 4, and 5, a fourthprocessor stores elements 4, 5, and 6, and a fifth processor storeselements 5, 6, and 7.

Another example of a suitable splitting is a stencil splitting, wherebyeach element (i,j) in a matrix and its north, south, east, and westneighbors is stored on a different processors. For example, as shown inFIG. 7A, element (2,3) of matrix 701 may be provided to a processor withits north, south, east, and west neighbors: element (1,3); element(2,2); element (2,4); and element (3,3). This may be done for eachelement (i,j) in the matrix. For elements along an edge of the matrix,such as element (4,1), the neighbors may wrap around or may be cut offand treated as zero. For example, the north neighbor of element (4,1) iselement (3,1) and the west neighbor is element (4,2). In embodimentswhich employ a wrap-around, its east neighbor may be treated as element(4,4) and its south neighbor may be treated as element (1,1). Inembodiments which employ a cut-off, its east and south neighbors may betreated as elements with a value of zero.

Another example of a suitable splitting is referred to as a multi-gridsplitting. In a multi-grid splitting, each odd element and itssubsequent even neighbor in a vector are averaged to generate a newelement and the new elements are combined to create a new vector. Thisprocess is repeated on the new vector and subsequent new vectors until avector of only a single element (i.e., a scalar) is generated. Forexample, as shown in FIG. 7B, in vector 703, elements 1 and 2 areaveraged, elements 3 and 4 are averaged, element 5 and 6 are averaged,and elements 7 and 8 are averaged. The result of each of these averageoperations is placed in a vector 705. In vector 705, elements 1 and 2are averaged and elements 3 and 4 are averaged, and the result of eachof these average operations is placed in a vector 707. In vector 707,elements 1 and 2 are averaged to generate vector 709 (a scalar). Eachvector (i.e., 703, 705, 707, and 709) may be stored on a differentprocessor.

Another example of splitting is a splitting of a spreadsheet, such as anExcel™, that is stored on the parallel server. That is, for example, ifthe spreadsheet has multiple sheets, each sheet may be stored on aprocessor of the parallel server. Alternatively, a single sheet in aspreadsheet may be row-split or column-split among the processors of theparallel server.

The illustrative splittings described above are only a few examples ofsplittings that may be used in various embodiments. The invention is notlimited to these splittings, as any suitable splitting may be used.

As discussed in connection with the examples above, a user may specify amanner in which data is to be split amongst the processors of theparallel server and an operation for each processor to perform on itsportion of the data. In some embodiments, the parallel server may notphysically distribute the data in the manner specified by the user, butrather the may maintain an abstract splitting of the data. For example,as shown in FIG. 6, parallel server 601 may have three physicalprocessors: 603 a, 603 b, and 603 c. Matrix 605 is a 2×3 matrix that isphysically row-distributed on processors 603 a and 603 b of parallelserver 601. That is, the first row of matrix 605 is stored on processor603 b and the second row of matrix 605 is stored on processor 603 a. Auser's program may include the line of code shown in Table 7 which whenexecuted causes the data referenced by the object ‘C’ (i.e., matrix 605in this example) to be column distributed and the ‘avg’ routine to berun on each processor using each respective processor's column of matrix605 as input to the ‘avg’ routine. Rather than physically redistributethe data such that each of physical processors 603 a, 603 b, and 603 cstores one column of matrix 605, matrix 605 may remain physicallyrow-distributed on processors on 603 a and 603 b. However, both the userand the parallel server may treat and operate on matrix 605 as if itwere column-distributed over three processors. As discussed above, thisis referred to as an abstract splitting and the three processor overwhich the matrix is abstractly split may be viewed as abstractprocessors. Though the user need only be aware of the abstractsplitting, the parallel server is aware of both the abstract splittingand the underlying physical distribution of the data and may performoperations on the physical data using the physical processors such thatthe user's desired result of the operation or operations using theabstract splitting among the abstract processors is achieved. This maybe done in any suitable way, as the invention is not limited in thisrespect.

For example, referring to FIG. 6, the parallel server may achieve theuser's desired result of the operation in Table 7 (i.e., averaging theelements in each column of the Matrix C) as follows. Processor 603 a maysend the first element of its row (i.e., “9”) to processor 603 b, whichmay use the first element from row 2 received from processor 603 b andthe first element from row 1 (i.e., “5”) stored thereon as input to the‘avg’ routine which is executed on processor 603 b. The output of the‘avg’ routine may be stored on processor 603 b. Processor 603 a may thensend the second element of its row to processor 603 b, which may thenexecute the ‘avg’ routine again using the second element of row 2received from processor 603 a and the second element of row 1 storedthereon as input to the ‘avg’ routine and may store the result.Processor 603 a may then send the third element of its row to processor603 b, which may then execute the ‘avg’ routine for a third time usingthe third element of row 2 received from processor 603 a and the thirdelement of row 1 stored thereon as input to the ‘avg’ routine and maystore the result.

Thus, from the perspective of the user, matrix 605 a iscolumn-distributed across three processors, though the physicaldistribution of the data is a row distribution across two processors. Inaddition, the parallel server may return a pointer or a handle that theclient may use to access the abstract matrices resulting from theperformance of the operation indicated in Table 7. This pointer orhandle may be stored in the object D, as shown in Table 7.

TABLE 7 D = ppeval(‘avg’, split(C,2));

As discussed above, the ppeval function in Table 5 causes a command tobe sent to the parallel server to column-distribute the data of thematrix referenced by the variable C and to execute the ‘avg’ routine oneach processor that stores a portion of the matrix, using the portion ofthe matrix stored on that processor as input to the routine. In theexample of Table 5, the result of running the ‘avg’ routine on a columnof the column-distributed matrix is a scalar that is the average of thevalues in the column. That is, the result of the ppeval function is thateach of the three processors that stores a column of the matrixreferenced by the variable C also stores a scalar that is the average ofthe values in the column stored by the processor.

In some embodiments, the ppeval function returns an object that includesa reference to each of the local pieces of the output of the functionspecified in the first argument of the ppeval function. Thus, in theexample of Table 5, the object D includes a reference to each of theoutputs of the ‘avg’ function. That is, the object D includes areference to each scalar output by the ‘avg’ function that is stored onone of the three processors on which the ‘avg’ function was executed.For example, as shown in FIG. 5, parallel server 501 may have threeprocessors 503 a, 503 b, and 503 c. Each of these processors may store ascalar that is the output of the ‘avg’ function. Object D 505, which isreturned by the ppeval function, may include a reference to each of thescalars.

As shown in Table 5, the user may manipulate and operate on the localdata (i.e., the scalars) using the reference to the data in the objectD. For example, the line of code D.a=D.a+1 causes processor 503 a to addone to the value of the scalar stored thereon. Similarly, the line ofcode D.b=D.b+1 causes processor 503 b to add one to the value of itsscalar and the line of code D.c=D.c+1 causes processor 503 c to add oneto the value of its scalar.

The user may subsequently join the local pieces into a global object andoperate on the global object using a global view. This may be done inany suitable way, as the invention is not limited in this respect. Forexample, as shown in Table 5, the line of code “E=ppjoin(D, 3, 1)” joinsthe local pieces referenced by the object the D and creates a globalobject, E, that references the matrix resulting from joining the scalarsreferenced by the object D. The function ppjoin is a function thatcauses a command to be sent to the parallel server to join local piecesinto a global object. In the example of Table 5, the ppjoin functiontakes three arguments. The first argument is the object that referencesthe local pieces (in this example, object D). The second and thirdarguments are the dimensions of the global matrix into which the objectwill be reconstituted. Thus, in the example of Table 5, the data ofreferenced by the object D may be joined in a 3×1 matrix.

In the example in Table 5 a user selects whether an operation is to beperformed globally or locally. However, the invention is not limited inthis respect, as in some embodiments, the decision whether to perform anoperation globally or locally may be made automatically. This may bedone in any suitable way, as the invention is not limited in thisrespect. For example, a pre-processor may recognize serial portions of auser's program that are suited for parallel local operation and causethese portions to be executed locally in parallel, rather than serially.For example, as shown in Table 8, rather than execute the “while” loopfive times serially on a single processor, the pre-processor mayrecognize that the five iterations of the “while” loop may be performedin parallel and may cause five processors of the parallel server to eachperform the operation a[n]=b*n in parallel, each using a different valueof n (i.e., where n is 0 through 4).

TABLE 8 n=1; while (n < 6){    a[n] = b*n;    n = n + 1; }

The embodiments described above may incorporate any or all of theabove-described aspects of the invention. Further, the above-describedembodiments of the invention are not mutually exclusive of each other,such that any feature or aspect of one embodiment may be used in anyother embodiment.

The above-described embodiments of the present invention can beimplemented in any of numerous ways. For example, the embodiments may beimplemented using hardware, software or a combination thereof. Whenimplemented in software, the software code can be executed on anysuitable processor or collection of processors, whether provided in asingle computer or distributed among multiple computers. It should beappreciated that any component or collection of components that performthe functions described above can be generically considered as one ormore controllers that control the above-discussed functions. The one ormore controllers can be implemented in numerous ways, such as withdedicated hardware, or with general purpose hardware (e.g., one or moreprocessors) that is programmed using microcode or software to performthe functions recited above. Further, when the embodiments areimplemented in software, such software may be accessed via download overa network.

It should be appreciated that one implementation of the presentinvention comprises at least one computer-readable medium (e.g., acomputer memory, a floppy disk, a compact disk, a tape, etc.) encodedwith a computer program (i.e., a plurality of instructions), which, whenexecuted on a processor, performs the above-discussed functions of theembodiments of the present invention. The computer-readable medium canbe transportable such that the program stored thereon can be loaded ontoany computer environment resource to implement the aspects of thepresent invention discussed herein. In addition, it should beappreciated that the reference to a computer program which, whenexecuted, performs the above-discussed functions, is not limited to anapplication program running on a host computer. Rather, the termcomputer program is used herein in a generic sense to reference any typeof computer code (e.g., software or microcode) that can be employed toprogram a processor to implement the above-discussed aspects of thepresent invention.

It should be appreciated that in accordance with several embodiments ofthe present invention wherein processes are implemented in a computerreadable medium, the computer implemented processes may, during thecourse of their execution, receive input manually (e.g., from a userand/or via external electrical connection).

The phraseology and terminology used herein is for the purpose ofdescription and should not be regarded as limiting. The use of“including,” “comprising,” “having,” “containing”, “involving”, andvariations thereof, is meant to encompass the items listed thereafterand additional items.

Having described several embodiments of the invention in detail, variousmodifications and improvements will readily occur to those skilled inthe art. Such modifications and improvements are intended to be withinthe spirit and scope of the invention. Accordingly, the foregoingdescription is by way of example only, and is not intended as limiting.The invention is limited only as defined by the following claims and theequivalents thereto.

1. A method of processing a computer program that manipulates a datastructure stored on a parallel server comprising a plurality ofprocessors, wherein a portion of the data structure is stored on each ofthe plurality of processors, and wherein the method comprises acts of:(a) executing a first routine based on code in the computer program thatcauses a first request to perform a first operation on the datastructure to be sent to the parallel server, wherein the first routineis a routine that overloads a serial routine that, when executed, causesthe first operation to be performed serially; and (b) executing a secondroutine based on code in the computer program that causes a secondrequest to be sent to the parallel server, wherein the second requestincludes an instruction to at least one specific processor of theplurality of processors to perform a second operation on the portion ofthe data structure stored on the at least one specific processor.